package com.example.demo.controller;


import com.example.demo.common.Result;
import com.example.demo.service.RankService;
import com.example.demo.utils.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 第五小组
 * @since 2021-08-04
 */
@RestController
@RequestMapping("/bilibili")
public class RankController {

    @Autowired
    RankService rankService;

    @GetMapping("/all")
    public Result rank(HttpServletResponse response){
        Util.exec("\\脚本\\rank.py ","all");
        return Result.succ(rankService.listMaps());
    }
}
